﻿// 项目：	Guan.CMS.Data - Guan.CMS
// 文件名：	MediaConfiguration.cs
//
// 修改时间：2013-03-09 9:28
// 修改人：	Cooclsee

using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using Guan.CMS.Model.Entities;

namespace Guan.CMS.Data.Configurations
{
    public class ContactConfiguration : EntityTypeConfiguration<Contact>
    {
        public ContactConfiguration()
        {
            ToTable("Contact");
            HasKey(c => c.Id);
            Property(c => c.Id).HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
            Property(c => c.Name).HasMaxLength(200).IsRequired();
            Property(c => c.Email).HasMaxLength(200);
            Property(c => c.IP).HasMaxLength(50);
            Property(c => c.Title).HasMaxLength(200);
            Property(c => c.Message).HasMaxLength(500);
        }
    }
}